package com.boot.demo.boot_mybatis.service.impl;

import com.boot.demo.boot_mybatis.entity.User;
import com.boot.demo.boot_mybatis.mapper.UserMapper;
import com.boot.demo.boot_mybatis.service.IUserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public boolean insert(User user) {
        return userMapper.insertUser( user);
    }

    @Override
    public boolean deleteById(Long id) {
        return userMapper.deleteUserById( id);
    }

    @Override
    public boolean update(User user) {
        return userMapper.updateUser( user);
    }

    @Override
    public User selectById(Long id) {
        return userMapper.selectUserById( id);
    }

    @Override
    public List<User> selectAll() {
        return  userMapper.selectUserAll() ;
    }
}
